1. Field of the Invention
The present invention relates to a method for measuring the distance of an object. In particular, the method of the present invention is carried out through an optical device for measuring the distance, which among the other things, is also able to read an optical code placed on the object.
2. Discussion of Prior Art
In many fields of the art, the measurement of the distance of an object is very useful, if not in some cases, essential. Consider, for example, all the mechanical machining where it is necessary to know the distance from the machine of the surface to be machined so as to position the tools correctly and/or to program the machine correctly, or all those cases in which knowing the distance parameter allows setting up instruments for the process optimization (for example, in the optics and photography fields, where the distance parameter is strictly connected to focusing issues).
Furthermore, the measurement of the distance of an object is often required in handling plants for the delivery and sorting of objects, where it is required to identify and classify objects having very different sizes, and to carry out an automatic measurement of the dimensions of objects, so as to accelerate and optimize the further stages of delivery and storage of the same.
Typically, these plants are provided with a conveyor belt on which the objects to be identified and sorted are placed, and with one or more optical devices, generally of the laser-light emission type (commonly referred to as laser scanner) intended for carrying out the reading of the optical codes and the measurement of the object dimensions.
For the purpose of making the above operations of reading and measurement reliable, it is preferable to previously have an information on the distance between the object and the laser scanner. In fact, knowing the distance parameter is useful on the one side to correctly focus the emission laser beam on the object to be scanned so as to make a correct reading of the optical code present on the object itself, and on the other side to determine the height of the latter and consequently, for example, its dimensions and/or volume. In addition, knowing the distance parameter in real time advantageously allows the adjustment of the operating parameters of the electronic circuits present in the scanner, so as to set prefixed operating configurations in the scanner itself.
Optical devices that can provide information on the distance of an object are already known. For example, the European patent application No. 0 652 530 by the same Applicant, describes a laser scanner having a high-frequency modulated laser-light emission wherein the distance of the object is obtained by the phase difference between the signal emitted by the scanner and the signal received. In particular, the scanner comprises a source of emission of amplitude-modulated laser light by a local oscillator; means of optical scanning to direct the laser light towards the object to be scanned, and light-receiving means to collect the light diffused by the illuminated object and generate an electric signal proportional to the intensity of the light diffused.
The signal generated by the light-receiving means is transmitted to a phase demodulator, which also receives a signal from the local oscillator; the demodulator measures a phase difference between the above indicated two signals and generates an electric signal proportional to said phase difference. Finally, suitable calculating means processes this electric signal so as to calculate a distance value based on the above phase difference.
It has been verified that the devices of the type described above do not allow carrying out a sufficiently precise measurement of the distance because of a certain number of drawbacks which cause an uncontrollable change of phase in the response signal generated by the phase demodulator, thus altering the measurement of the distance.
In fact, the phase response obtained from the modulated-light devices is related to the distance of the object that reflects the modulated light by a relation as the following one:D=A0+A*arc cos(φ+φ0)wherein:                D is the distance of the object;        A0 is the offset of the amplitude of the signal generated by the phase demodulator;        A is the amplitude of the signal generated by the phase demodulator;        φ is the phase of the signal generated by the phase demodulator;        φ0 is the initial phase of the emission signal.        
In this description and following claims, the term: offset of the signal, refers to a position error on the plane of the phase/distance transfer function.
Therefore, the measurement of the distance requires the knowledge of parameters A, A0 and φ0, and of the phase φ of the response signal generated by the phase demodulator.
However, the use of this formula would be correct if the response given by the optical/electronic (scanning generation, demodulation, amplification and filtration) measurement system were of the linear type. Actually, however, the optical/electronic system has intrinsic non-linearity (due, for example, to the non-linearity of the single demodulation, amplification and filtration systems) that make the above relation inapplicable from a practical point of view. In addition, the above non-linearity changes from apparatus to apparatus.
One of the most evident problems associated to the use of this relation, for example, is correlated to the fact that, to have a response as much linear as possible from the measurement system, it is necessary to work within a prefixed interval of values of phase φ, in particular, in the range comprised between φ=0 and φ=1. In this interval, as the phase increases, the distance calculated suddenly decreases. This means that also small quantities of noise on the signal can cause significant changes in the distance value calculated by the above relation.
Furthermore, the above relation shows that undesired and uncontrolled changes in the phase φ alter the measurement of the distance. These variations can be caused, for example, by changes in the operating temperature of the device, which cause an uncontrollable variation of the distance signal/distance transfer function, and in particular, of the phase of the signals emitted and received respectively by the device itself.
Also the electronic components of the device (in particular, the phase demodulator, the amplifier and the band-pass filter) introduce uncontrollable variations in the transfer function with the temperature, and thus, in the phase of the response signal at the output of the phase demodulator.
In addition, ageing and dimensional tolerances of the optical and electronic components of the devices themselves cause uncontrollable variations in the phase of the response signal.
In short, it has been verified that the above problems found in modulated-light devices imply a general error of measurement of the distance which is in the order of 5% on average. This error percentage restricts the use of the above devices only to those applications where a not repeatable and very precise measurement of the distance is required.
An attempt to overcome the above drawbacks consists in effecting a setting operation of the response curve of the device: in practice, an object is placed at a certain known distance from the device and, observing the behavior of the response signal through an oscilloscope, the device is adjusted by a potentiometer so that the phase response curve gives a prefixed distance value (equal to that at which the object has been placed). However, this setting operation is quite approximate. In fact, it is based on operations depending on the operator's sensitivity (such as the visual observation of the curve behavior, and its comparison with an ideal behavior), which can clearly cause several mistakes, thus giving unreliable results.
Other devices are known for the measurement of the distance of an object in relation to the so-called “time of flight” of a pulse applied to an emission laser. In particular, the time taken by the pulse to travel the optical distance from the emission means to the object, and from the latter to the light-receiving means is measured. This time is proportional to twice the distance between object and device.
However, it has been verified that although pulse devices do not specifically suffer the previously listed drawbacks, they suffer from problems implying intrinsic errors of precision and repeatability, assessable in the order of ±5 cm, thus being particularly adapted for measuring the distance of large objects and with quite extended scanning areas.
The technical problem at the basis of the present invention is to carry out a simple and reliable measurement of the distance, that is to provide for a reliable distance measurement which is not influenced by the intrinsic non-linearity of the system.